package com.pipe.factory;

import com.pipe.config.OSSProperties;
import com.pipe.enums.OssFirmEnum;
import com.pipe.service.OssService;
import com.pipe.service.impl.AiLiOssServiceImpl;
import com.pipe.service.impl.QiNiuOssServiceImpl;


/**
 * @ClassName OssFactory
 * @Author HETAO
 * @Date 2020/7/10 14:05
 */

public class OssFactory {
    public static OssService createOss(String option, OSSProperties prop) {
        if (OssFirmEnum.QINIU_OSS.getValue().equals(option)) {
            return new QiNiuOssServiceImpl(prop);
        }else if (OssFirmEnum.ALI_OSS.getValue().equals(option)){
            return new AiLiOssServiceImpl(prop);
        }else {
            return null;
        }
    }
}
